package cn.sinata.wanglin.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;
import java.util.List;

import cn.sinata.wanglin.mine.fragment.QuanzibaguaFragment;
import cn.sinata.wanglin.model.SameCityClass;
import cn.sinata.wanglin.village.fragment.FriendPersonInfoFragment;
import cn.sinata.wanglin.village.fragment.OtheruserActiveFragment;
import cn.sinata.wanglin.village.fragment.SameCityListFragment;

/**
 * description：
 * Created by kaihongwu on 2016/12/13 下午 3:32
 */
public class UserinfoPagerAdapter extends FragmentStatePagerAdapter {
    private ArrayList<String> mdatas;
    private String friendID;
    public UserinfoPagerAdapter(FragmentManager fm, ArrayList<String> mdatas,String friendID) {
        super(fm);
        this.mdatas=mdatas;
        this.friendID= friendID;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position){

            case 0:
                return FriendPersonInfoFragment.newInstance(friendID);

            case 1:
                return  QuanzibaguaFragment.newInstance(friendID);

            case 2:
                return  OtheruserActiveFragment.newInstance(friendID);

        }
        return new Fragment();
    }

    @Override
    public int getCount() {
        return mdatas.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return mdatas.get(position);
    }
}
